//
//  SISSStarsShowView.m
//  SISSAPP
//
//  Created by 优房网 on 2017/5/2.
//  Copyright © 2017年 优房网. All rights reserved.
//

#import "SISSStarsShowView.h"

@interface SISSStarsShowView ()
@property (strong, nonatomic) IBOutletCollection (UIImageView) NSArray *starImageViews;
@end
@implementation SISSStarsShowView

- (void)awakeFromNib {
    [super awakeFromNib];
    self.backgroundColor = [UIColor clearColor];
}

- (void)setStars:(NSInteger)stars {
    _stars = stars;
    self.backgroundColor = [UIColor clearColor];
    for (NSInteger i = 0; i < self.subviews.count; i++) {
 
        NSString *imageName;
        if (self.isInfo) {
            imageName = stars > i ? @"star_full" : @"";
        } else {
            imageName = stars > i ? @"star_评价_01" : @"star_评价_02";
        }
        
        UIImageView *imageView = self.subviews[i];
        imageView.image = [UIImage imageNamed:imageName];
    }
}

@end
